Blok Game
This is a game I made just for fun. You move around inside a random field of blocks and bombs and place your explosive to kill enemies. Gameplay You are a cross. Your enemies appear as four corners of a square. Blocks appear as black squares, and bombs are missing the center dot of a block. You place an explosive and set it off near enemies to kill them. If you set it off near a bomb, the bomb will explode as well, and chain reactions can be created this way. Blocks and bombs can both be moved by you. You can only move a block or bomb into an empty space, not another occupied square. When moving a bomb, there is a small chance it explodes when you push it. You can also move your own mine, but it is probable easier to pick it up and put it down somewhere else. Blocks are destructible, except for the walls keeping you in the map. Enemies can also move blocks. They sometimes detonate themselves when near you. When they get close to you, they kill you. You can blow yourself up. The game ends when all enemies are dead or you are. You get points whenever you kill an enemy. Killing multiple enemies at once or chaining explosions earn you more points. You also get more points for fighting multiple enemies. The points you can get in a game range from 9 to over 100 billion (in theory). Controls The arrow keys move you around. Pressing 2nd places a your explosive. Press 2nd again when next to it to pick it up. Press ALPHA to detonate it. Explosions destroy blocks in contact with their sides or corners. Code :ClrHome :Func :Full :FnOff :FnOn :PlotsOff :CoordOff :GridOff :AxesOff :LabelOff :ExprOff :0 Xmin :-62 Ymin :1 ΔX :1 ΔY :SetUpEditor 1 :SetUpEditor 2 :SetUpEditor 3 :SetUpEditor HBLOK :If 8 dim( HBLOK :{0,0,0,0,0,0,0,0 HBLOK :Lbl 0 :ClrHome :Output(1,4,"BLOK GAME :Output(2,1,"---------------- :Output(3,1,">PLAY :Output(4,2,"SCORES :Output(5,2,"EXIT :3 N :Repeat FV=105 :getKey FV :If (FV=25 and N 3) or (FV=34 and N 4 :Then :Output(N,1," " :N+(FV=34)-(FV=25 N :Output(N,1,"> :End :End :ClrHome :If N=3 :Goto 1 :If N=4 :Goto 2 :ClrHome :DelVar 1 :DelVar 2 :DelVar 3 :Delvar Pic0 :Output(1,1," :Stop :Lbl 1 :ClrDraw :For(X,-5,0 :Horizontal X :Horizontal X-57 :End :For(X,0,6 :Vertical X :Vertical X+88 :End :randInt(75,125 I% :For(X,1,I% :Repeat not(pxl-Test(e2fPart(Ans),iPart(Ans :3randInt(3,29)-1+.01(1+3randInt(2,18 :End :Pt-On(iPart(Ans),-fPart(Ans)e2,2 :Pt-On(iPart(Ans).-e2fPart(Ans :End :randInt(25,75 I% :For(X,1,I% :Repeat not(pxl-Test(e2fPart(Ans),iPart(Ans :3randInt(3,29)-1+.01(1+3randInt(2,18 :End :Pt-On(iPart(Ans),-fPart(Ans)e2,2 :End :Repeat not(pxl-Test(e2fPart(Ans)-1,iPart(Ans :3randInt(3,29)-1+.01(1+3randInt(2,18 :End :Ans N :Pt-On(iPart(N),-fPart(N)e2,3 :randInt(1,5 I% :I% dim( 2 :For(X,1,I% :Repeat not(pxl-Test(e2fPart(Ans)-1,iPart(Ans :3randInt(3,29)-1+.01(1+3randInt(2,18 :End :Ans 2(X :Pt-On(iPart(Ans),-fPart(Ans)e2,2 :Pt-Off(iPart(Ans),-fPart(Ans)e2,3 :End :0 PV :0 PMT :0 dim( 1 :augment({N}, 2 3 :StorePic 0 :Lbl X :Repeat FV=45 or not(dim( 2 :getKey FV :If FV=34 or (24≤FV and FV≤26 :Then :Pt-Off(iPart(N),-fPart(N)e2,3-2(N=PV :If not(pxl-Test(e2fPart(N)-1+3(FV=34)-3(FV=25),iPart(N)+3((FV=26)-(Fv=24 :Then :N+3((FV=26)-(FV=24)+.01((FV=34)-(FV=25 N :Else :If not(pxl-Test(e2fPart(N)-1+6(FV=34)-6(FV=25),iPart(N)+6((FV=26)-(FV=24 :Then :N+3((FV=26)-(FV=24)+.01((FV=34)-(FV=25 N :If N=PV :Then :PV+3((FV=26)-(FV=24)+.01((FV=34)-(FV=25 PV :Pt-Off(iPart(N),-fPart(N)e2,3 :Pt-On(iPart(PV),-fPart(PV)e2,3 :Pt-Off(iPart(PV),-e2fPart)PV :Else :If pxl-Test(e2fPart(N),iPart(N :Then :Pt-Off(iPart(N),-fPart(N)e2,2 :Pt-On(iPart(N)+3(FV=26)-3(FV=24),-fPart(Ans)e2+3(FV=34)-3(FV=25),2 :Pt-On(iPart(N)+3(FV=26)-3(FV=24),3(FV=34)-3(FV=25)-e2fPart(Ans :Else :Pt-Off(iPart(N),-fPart(N)e2,2 :Pt-On(iPart(N)+3(FV=26)-3(FV=24),-fPart(Ans)e2+3(FV=34)-3(FV=25),2 :If not(randInt(0,19 :{N+3((FV=26)-(FV=24)+.01((FV=34)-(FV=25 1 :End :End :End :End :Pt-On(iPart(N),-fPart(N)e2,3 :End :If FV=21 :Then :If PV :Then :If 3≥√((iPart(N)-iPart(PV)) +(e2fPart(N)-e2fPart(PV))2 :Then :Pt-Off(iPart(PV),-fPart(PV)e2,3 :0 PV :N PV :End :End :If FV=31 and PV :Then :If dim( 1 :augment( 1,{PV 1 :If not(dim( 1 :Then :1 X :Repeat X>dim 1 : 1(X PMT :If pxl-Test(e2fPart(PMT)-1,iPart(PMT)) and not(pxl-Test(e2fPart(PMT),iPart(PMT :Then :If not(max( 1=(PMT-3.03 :PMT-3.03 1(1+sum( 1 0 :If not(max( 1=(PMT-.03 :PMT-.03 1(1+sum( 1 0 :If not(max( 1=(PMT+2.97 :PMT+2.97 1(1+sum( 1 0 :If not(max( 1=(PMT-3 :PMT-3 1(1+sum( 1 0 :If not(max( 1=(PMT+3 :PMT+3 1(1+sum( 1 0 :If not(max( 1=(PMT-2.97 :PMT-2.97 1(1+sum( 1 0 :If not(max( 1=(PMT+.03 :PMT+.03 1(1+sum( 1 0 :If not(max( 1=(PMT+3.03 :PMT+3.03 1(1+sum( 1 0 :sum( 1 0 dim( 1 :End :If PV=PMT :0 PV :If N=PMT :45 FV :If max(PMT= 2 : 2-( 2*(PMT= 2 2 :If iPart(PMT) 5 and iPart(PMT) 89 and fPart(PMT) .04 and .58 fPart(PMT :Then :Pt-Off(iPart(PMT),-fPart(PMT)e2,2 :Pt-Off(iPart(PMT),-e2fPart(PMT :End :X+1 X :End :If FV=31 and not(min( 2 :n+dim( 2)(iPart(√(dim( 3)-1)dim( 1)^(sum(not( 2 n :0 dim( 1 :End :If not(min( 2 :Then :SortD( 2 :sum( 2 0 dim( 2 :End :If dim( 2 :Then :For(X,1,dim( 2 : 2(X I% :randInt(0,4 :If Ans :Then :Pt-Off(iPart(I%),-fPart(I%)e2,2 :If Ans=1 or Ans=2 :Then :If Ans=1 :Then :I%+3randInt(-1,1 PMT :Else :I%+.03randInt(-1,1 PMT :End :Else :If Ans=3 :Then :I%+3(N>I%)-3(NN)>fPart(I%))-.03(fPart(N)N)-iPart(Ans)) +(e2fPart(N)-e2fPart(Ans)) :If Ans≤6 :Then :If Ans≤3 :Then :45 FV :Else :If randInt(0,1) and 3≤dim( 2 :Then :Pt-On(iPart( 2(X)),-fPart( 2(X))e2,2 : 2(X 1 :End :End :End :End :End :End :If FV=45 :Then :For(X,1,100 :If fPart(X/2 :Pt-Off(iPart(N),-fPart(N)e2,2 :If not(fPart(X/2 :Then :Pt-On(iPart(N),-fPart(N)e2,2 :Pt-Off(iPart(N),-fPart(N)e2,3 :Pt-On(iPart(N),-e2fPart(N :End :End :For(X,0,200 :0 :End :End :Pt-Off(iPart(N),-fPart(N)e2,2 :Pt-Off(iPart(N),-e2fPart(N :getKey :Repeat Ans :getKey :End :ClrDraw :If FV=45 :Then :Output(1,5,"YOU DIED :Output(2,1,"---------------- :Output(3,1,">TRY AGAIN :Output(4,2,"RETURN TO MAIN :3 N :Repeat FV=105 :getKey FV :If (FV=25 and N 3) or (FV=34 and N 4 :Then :Output(N,1," " :N+(FV=34)-(FV=25 N :Output(N,1,"> :End :End :ClrHome :Else :Output(1,2," YOU WON :Output(2,1,"SCORE: :Output(2,8,n :Output(3,1,"---------------->MAIN MENU :4 N :getKey :Repeat Ans=105 :getKey :End :If n>min( HBLOK :Then :ClrHome :Output(1,3,"HIGH SCORE! :n HBLOK(8 :SortD( HBLOK :getKey :Repeat Ans :getKey :End :5 N :End :End :If N=5 :Goto 2 :If N=4 :Goto 0 : 3(1 N :seq( 3(n),n,2,dim( 3 2 :0 PV :0 n :RecallPic 0 :Goto X :Lbl 2 :ClrHome :For(X,1,8 :Output(X,1,X :Output(X,2,": :Output(X,4, HBLOK :End :getKey :Repeat Ans :getKey :End :ClrHome :Goto 0 Made by LordoftheBleak. Category:Programing Examples Category:TI-Basic 84 Programing